const list = wx.getStorageSync('cartStore') || [
  {
    uid: '88888888205468',
    saasId: '88888888',
    storeId: '1000',
    spuId: '12',
    skuId: '135691622',
    isSelected: 1,
    thumb:
      'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png',
    title:
      '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率',
    primaryImage:
      'https://cdn-we-retail.ym.tencent.com/tsr/goods/dz-3a.png',
    quantity: 1,
    stockStatus: true,
    stockQuantity: 2,
    price: '9900',
    originPrice: '16900',
    tagPrice: null,
    titlePrefixTags: [{ text: '新品' }, { text: '火爆' }],
    roomId: null,
    specInfo: [
      {
        specTitle: '颜色',
        specValue: '经典白',
      },
      {
        specTitle: '类型',
        specValue: '经典套装',
      },
    ],
    joinCartTime: '2020-06-29T07:55:40.000+0000',
    available: 1,
    putOnSale: 1,
    etitle: null,
  },
]
export const cartStore = {
  list,
  Set_cartStore(item) {
    const hasItemIndex = list.findIndex(i => { return i.skuId == item.skuId })
    if (hasItemIndex >= 0) {
      list[hasItemIndex].quantity += 1
    } else {
      list.push(item)
    }
    wx.setStorageSync('cartStore', list)
  },
  Get_cartStore() {
    return list
  }
}

